import updateManager from './common/updateManager';

App({
  onLaunch: async function () {
    wx.cloud.init();
    const { result } = await wx.cloud.callFunction({
      name: 'getOpenId',
    });
    wx.setStorageSync('openId', result.openid);
  },
  onShow: async function () {
    // await wx.request({
    //   url: 'http://localhost:5006/getWxAeeassToken',
    //   method: 'GET',
    //   success: ({ data }) => {
    //     wx.setStorage({ key: 'AEEASSTOKEN', data: data.access_token });
    //     wx.request({
    //       url: 'http://localhost:5006/?accessToken=',
    //       method: 'POST',
    //       headers: { 'content-type': 'text/plain' },
    //       // eslint-disable-next-line camelcase
    //       data: { accessToken: data.access_token, env: 'cloud1-4glomr2kc2626401', collection_name: 'test_http' },
    //       success: (re) => {
    //         console.log('re', re);
    //       },
    //     });
    //   },
    // });

    updateManager();
  },
});
